﻿#pragma once

#include <string>
#include <unordered_map>
#include <map>
#include <vector>

class Logger;

class SellDataInfo {
  std::string file1Path;
  Logger& logObj;

  int nameIndex2{ -1 };
  int quantityIndex2{ -1 };
  bool readInfoSucc{ false };
  bool InitSucc()const { return readInfoSucc; }

  std::vector<std::string> header2;
  std::map<std::string, std::vector<std::vector<std::string>>> data2;

  bool ReadSellInfo();
  bool OrignzeInfo(const std::vector<std::vector<std::string>> &dataOri);
public:
  explicit SellDataInfo(const std::string& file, Logger& log);
  void ParseToOutput(const std::unordered_map<std::string, std::vector<std::string>>& data
    , int IDIndex, int unitPriceIndex, int BarCodeIndex);

  static std::string KeyColName() { return "商品名称"; }
  static std::string PurchaserKeyColName() { return "客户名称"; }
  static std::string SellNumColName() { return "下单数量"; }
};
